#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* qsort C-string comparison function */ 
int cstring_cmp(const void *a, const void *b) 
{ 
    const char **ia = (const char **)a;
    const char **ib = (const char **)b;
    return strcmp(*ia, *ib);
	/* strcmp functions works exactly as expected from
	comparison function */ 
} 
  
/* sorting C-strings array using qsort() example */ 
void sort(char **strings, int size) 
{ 
    size_t strings_len = sizeof(strings) / sizeof(char *); 
    /* sort array using qsort functions */ 
    qsort(strings, size, sizeof(char *) ,cstring_cmp);
} 